#!/bin/bash

STATUS=("active" "working")

function usage {
    echo "Usage: $0 [${STATUS[@]}]"    
}

function func_active {
    ln -f index_up.php index.php
    echo "The website is active now!"
}

function func_working {
    ln -f index_down.php index.php
    echo "We are working, come back soon!"
}

if [ $# -ne 1 ]; then 
    usage
    exit 1
fi

for act in ${STATUS[@]}; do 
    if [[ $act -eq $1 ]]; then 
	func_$1
	exit 0
    fi
done

echo "Unknown option!"
usage
exit 1